package com.concerneyes.health;

import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;

import com.concerneyes.R;
import com.concerneyes.health.adapter.HisDataAdapter;

import common.AbsActivity;
import util.ActivityUtil;
import view.PagerSlidingTabStrip;

/**
 * 历史数据
 */

public class HisDataActivity extends AbsActivity implements OnPageChangeListener {
    private PagerSlidingTabStrip mTabStrip;
    private ViewPager mViewpager;
    private HisDataAdapter adapter;
    private String manId;
    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_his_data);
        manId = getIntent().getExtras().getString("manId");
        setTitle(R.string.his_data);
        initView();
    }

    private void initView() {
        mTabStrip = (PagerSlidingTabStrip) findViewById(R.id.tabStrip);
        mTabStrip.setTextColorResource(R.color.white);
        mTabStrip.setTextSize(ActivityUtil.sp2px(14));
        mViewpager = (ViewPager) findViewById(R.id.viewpager);
        mViewpager.addOnPageChangeListener(this);
        adapter = new HisDataAdapter(this,manId);
        mViewpager.setAdapter(adapter);
        mTabStrip.setViewPager(mViewpager);
    }

    @Override
    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

    }

    @Override
    public void onPageSelected(int position) {

    }

    @Override
    public void onPageScrollStateChanged(int state) {

    }
}
